//
// Created by Luis on 2022/4/14.
//

#ifndef FFMPEG_LYQUEUE_H
#define FFMPEG_LYQUEUE_H

#include "LYPlaystatus.h"
#include "queue"
#include "pthread.h"
#include "AndroidLog.h"
extern "C"{
#include "include/libavcodec/packet.h"
#include "include/libavcodec/avcodec.h"
};
class LYQueue {
public:
    std::queue<AVPacket *> queuePacket;
    pthread_mutex_t mutexPacket;
    pthread_cond_t condPacket;
    LYPlaystatus *playstatus = nullptr;

public:
    LYQueue(LYPlaystatus *playstatus);
    ~LYQueue();
    int putAvpacket(AVPacket *packet);
    int getAvpacket(AVPacket *packet);
    int getQueueSize();

    void clearAvpacket();
};
#endif //FFMPEG_LYQUEUE_H
